<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<script type="text/javascript">
	$(function(){
			
		 
		
		 $("#form").validator({},{
				callback:function(results){
					$("#form").ajaxSubmit(function(data) {
			        	 myDialog.close();
			        	 myDialog =  art.dialog({icon: data.success,content: data.message,lock:true});
			        	 $("#gridTable").trigger("reloadGrid", [{page:1}]); 
			         }); 
				}
			});
	});
	
	 function checkRoleName() {
		 	var $target = $("#name");
			var result = new Object();
			result.result = true;
			result.msg = "验证通过";
			var pattern = new RegExp("[`~!@#$^&*=|{}':;',\\[\\].<>/?~！@#￥……&*（）——|{}【】‘；：”“'。，、？]");
			if($.trim($target.val()) != "" && $.trim($target.val()).match(pattern)){
				result.result = false;
				result.msg = "不能包含特殊字符";
			}
			return result;
		}
</script>
			<form  method="post" id="form" action="cms/role/modify">
		 
				<input name="id" type="hidden" value="${role.id }"/>
				
				<ul class="all_list">
					<li>
						<span class="all_title">角色名称：</span> 
						<span><input type="text" id="name" name="name" class="ui_input" value="${role.name }"  validator='{"label":"角色名称","maxLength":20,"customFun":"checkRoleName"}' /></span>
					</li>
					<li>
						<span class="all_title">角色编号：</span> 
						<span><input type="text" id="code" name="code" class="ui_input" value="${role.code }" maxlength="3"  validator='{"label":"角色编号","maxLength":3,"minLength":3,"isDigit":true}'/></span>
					</li>
					<li>
							<span class="all_title">备注：</span>
							<span><input type="text" class="ui_input" name="remark" id="remark" value="${role.remark }"  validator='{"label":"备注","maxLength":30,"required":false}'/></span>
					</li>
					<li>
							<span class="all_title"></span>
							<span><input type="button" id="addButton" class="submit_btn submitBtn"  name="addButton"  value="提 交"></span>
					</li>
				</ul>
			</form>
